<template>
  <div>
    <el-row :gutter="10" style="margin: 15px 0">
      <el-col :span="6">
        <el-card>
          <Detail title="总销售额" :count="count">
            <template slot="charts">
              <span class="text" style="float: left"
                >周同比&nbsp;56.67%
                <svg
                  t="1653806869254"
                  class="icon"
                  viewBox="0 0 1024 1024"
                  version="1.1"
                  xmlns="http://www.w3.org/2000/svg"
                  p-id="6936"
                  width="12"
                  height="12"
                >
                  <path
                    d="M858.9 689L530.5 308.2c-9.4-10.9-27.5-10.9-37 0L165.1 689c-12.2 14.2-1.2 35 18.5 35h656.8c19.7 0 30.7-20.8 18.5-35z"
                    p-id="6937"
                    fill="#d81e06"
                  ></path></svg
              ></span>
              <span class="text" style="float: right"
                >日同比 19.16%
                <svg
                  t="1653807005514"
                  class="icon"
                  viewBox="0 0 1024 1024"
                  version="1.1"
                  xmlns="http://www.w3.org/2000/svg"
                  p-id="7876"
                  width="12"
                  height="12"
                >
                  <path
                    d="M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"
                    p-id="7877"
                    fill="#37d31a"
                  ></path></svg
              ></span>
            </template>
            <template slot="footer">
              <span>日销售额 {{ salesToday }}</span>
            </template>
          </Detail>
        </el-card>
      </el-col>
      <el-col :span="6">
        <el-card>
          <Detail title="访问量" :count="visitTotal">
            <template slot="charts">
              <lineCharts></lineCharts>
            </template>
            <template slot="footer">
              <span>日访问量 {{ visitToday }}</span>
            </template>
          </Detail>
        </el-card>
      </el-col>
      <el-col :span="6">
        <el-card>
          <Detail title="支付笔数" :count="payTotal">
            <template slot="charts"><barCharts></barCharts></template>
            <template slot="footer">
              <span>转化率 {{ payRate }}</span>
            </template>
          </Detail>
        </el-card>
      </el-col>
      <el-col :span="6">
        <el-card>
          <Detail title="运营活动效果" count="78%">
            <template slot="charts"><progressCharts></progressCharts></template>
            <template slot="footer">
              <span
                >周同比&nbsp;56.67%
                <svg
                  t="1653806869254"
                  class="icon"
                  viewBox="0 0 1024 1024"
                  version="1.1"
                  xmlns="http://www.w3.org/2000/svg"
                  p-id="6936"
                  width="12"
                  height="12"
                >
                  <path
                    d="M858.9 689L530.5 308.2c-9.4-10.9-27.5-10.9-37 0L165.1 689c-12.2 14.2-1.2 35 18.5 35h656.8c19.7 0 30.7-20.8 18.5-35z"
                    p-id="6937"
                    fill="#d81e06"
                  ></path></svg
              ></span>
              <span
                >日同比 19.16%
                <svg
                  t="1653807005514"
                  class="icon"
                  viewBox="0 0 1024 1024"
                  version="1.1"
                  xmlns="http://www.w3.org/2000/svg"
                  p-id="7876"
                  width="12"
                  height="12"
                >
                  <path
                    d="M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"
                    p-id="7877"
                    fill="#37d31a"
                  ></path></svg
              ></span>
            </template>
          </Detail>
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import Detail from "./Detail";
import lineCharts from "./lineChart";
import barCharts from "./barChart";
import progressCharts from "./progressChart";
export default {
  name: "",
  components: {
    Detail,
    lineCharts,
    barCharts,
    progressCharts,
  },
  computed: {
    //总销售额
    count() {
      return this.$store.state.home.list.salesTotal;
    },
    //日销售额
    salesToday() {
      return this.$store.state.home.list.salesToday;
    },
    //日访问量
    visitToday() {
      return this.$store.state.home.list.visitToday;
    },
    //访问量
    visitTotal() {
      return this.$store.state.home.list.visitTotal;
    },
    //转化率
    payRate() {
      return this.$store.state.home.list.payRate;
    },
    //支付笔数
    payTotal() {
      return this.$store.state.home.list.payTotal;
    },
  },
};
</script>

<style lang="css" scoped>
.text {
  margin: 10px 0;
  color: rgb(110, 108, 108);
  font-size: 14px;
}
</style>
